import React, { PropTypes, Component } from 'react'


class WidgetImage extends Component {
 constructor(props, context) {
    super(props, context)
    this.state={
      menuShow:false
    }

  }

 handleWidgetMenuShow(e,componentId,positionId){
    this.props.handleWidgetMenuShow(e,componentId,positionId)
 }
 
  render() {
    let { widget}=this.props

    return (
      
      <div style={widget.conStyles} key={widget.componentId} 
          onClick={(e)=>this.handleWidgetMenuShow(e,widget.componentId,widget.positionId)}
                >
                
              <img src={widget.imgSrc} style={widget.styles} alt="" />
            
       </div>
        
    )
  }
}

WidgetImage.propTypes = {
  widget:PropTypes.object,
  handleWidgetMenuShow:PropTypes.func
}

export default WidgetImage
